/**
 * 解析headers
 * @param {*} request 
 * @param {*} headers 
 * @returns 
 */
export function pruneRequest(request, headers) {
  const postData = request.request.method === "POST" ? request.request.postData.text : "";
  return {
    postData,
    plainUrl: request.plainUrl,
    method: request.request.method,
    status: request.response.status,
    httpVersion: request.response.httpVersion,
    url: request.request.url,
    description: request.description,
    key: request.key,
    content: request.response.content,
    headers,
  };
}